export default{
    getDefinitionXML({commit}, param){
        return new Promise((resolve) =>{
            $axios.get(`/workflow/web/processDefinition/getDefinitionXML?deploymentId=${param.deploymentId}&resourceName=${param.resourceName}`).then((response) =>{
                // resolve(JSON.parse(response.data));
                resolve(response.data);
            }).catch((error) =>{
                resolve({success: false})
            })
        })
    },
    getInstances({commit}){
        return new Promise((resolve) =>{
            $axios.get(`/workflow/web/processInstance/getInstances`).then((response) =>{
                resolve(JSON.parse(response.data));
                // resolve(response.data);
            }).catch((error) =>{
                resolve({success: false})
            })
        })
    },
    getHighLine({commit},param){
        return new Promise((resolve) =>{
            $axios.get(`/workflow/web/activitiHistory/getHighLine?instanceId=${param}`).then((response) =>{
                resolve(JSON.parse(response.data));
                // resolve(response.data);
            }).catch((error) =>{
                resolve({success: false})
            })
        })
    }
}